#!/bin/sh

if [ "$1." != "c." ]
then
	echo "G."
	echo " "
	ps -eaf --cols 400 | grep "ibm/sa/apps/SAINST" | grep -v grep >/dev/null 2>&1 || ps -eaf --cols 400 | grep "ibm.sa.apps.SAINST" | grep -v grep >/dev/null 2>&1 
	[ $? -eq 0 ]  &&  sa="Service Agent Basic Configuration Interface is active" || sa=" "
else
	echo "Checking status of Service Agent Client."
	sa=" "
	echo " "
fi
ps -eaf --cols 400 | grep "ibm/ecf/apps/ODS" | grep -v grep >/dev/null 2>&1 || ps -eaf --cols 400 | grep "ibm.ecf.apps.ODS" | grep -v grep >/dev/null 2>&1
[ $? -eq 0 ]  &&  echo "Service Agent On Demand Server (ODS) is running" || echo "Service Agent On Demand Server (ODS) is NOT running"
echo " "
ps -eaf  --cols 400| grep "ibm/sa/apps/SAUI" | grep -v grep >/dev/null 2>&1 || ps -eaf  --cols 400| grep "ibm.sa.apps.SAUI" | grep -v grep >/dev/null
[ $? -eq 0 ]  &&  echo "Service Agent Advanced Interface is active" || echo "" 
echo "$sa"
echo " "
ps -eaf | grep svcagent|grep -v grep|grep "/usr/bin/errpt">/dev/null 2>&1
[ $? -eq 0 ]  &&  echo "Service Agent Error Log process is active" || echo "" 
sleep 2
echo " "
